{% extends 'base.html' %}
{% include 'link_css.html' %}
{% block self_head_css_js %}
    {#    <link href="/static/alert/chosen.min.css" rel="stylesheet">#}
    <link href="/static/css/new_style.css" rel="stylesheet">
    <link href="/static/alert/select2.min.css" rel="stylesheet">
    <link href="/static/css/plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet">
    <link href="/static/css/plugins/datepicker/datepicker3.css" rel="stylesheet">
{% endblock %}
{% block self_footer_js %}
    {#    <script src="/static/alert/chosen.jquery.min.js"></script>#}
    <script src="/static/alert/select2.min.js"></script>
    <script src="/static/js/timepicker/bootstrap-timepicker.js"></script>
    <script src="/static/js/datapicker/bootstrap-datepicker.js"></script>
{% endblock %}
{% block content %}
    <div class="tabs-container">
        <ul class="nav nav-tabs">
            <li id="projectInfo" class=""><a href="/asset/project/init/list/">项目初始化</a></li>
            <li id="approvalLevelList" class=""><a href="/asset/project/level/list/">审批级别</a></li>
            <li id="initTemplate" class="" style="display: none"><a href="/asset/project/template/list/">通用模板</a>
            </li>
            <li id="publishSheet" class=""><a href="/asset/project/publishsheet/list/">发布单</a></li>
            <li id="createTab" class="active" style="display: none"><a data-toggle="tab" href="#tab-3">创建发布单</a></li>
            <li id="doneSheet" class=""><a href="/asset/project/publishsheet/list/done/">完成&作废</a></li>
            <li id="publishResult" class="" style="display: none"><a href=#>发布结果</a>
            </li>
        </ul>
        <div class="tab-content">
            <div id="tab-3" class="tab-pane active">
                <div class="wrapper wrapper-content animated fadeInRight">
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="ibox">
                                <div class="ibox-content">
                                    <form role="form" id="publish_form">

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;发布日期</label>
                                                    <div class="input-group date" data-provide="datepicker">
                                                        <input type="text" id="datepicker" class="form-control"
                                                               autocomplete="off">
                                                        <div class="input-group-addon">
                                                            <span class="glyphicon glyphicon-th"></span>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;开始发布时间</label>
                                                    <div class="input-group bootstrap-timepicker timepicker">
                                                        <input type="text"
                                                               class="form-control timepicker" id="publish_time">
                                                        <span class="input-group-addon"><i
                                                                class="glyphicon glyphicon-time"></i></span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;发布项目</label>
                                                    <select class="form-control" id="project_name"
                                                            data-live-search="true">
                                                        {% for projectinfo in gogroup_objs %}
                                                            <option value={{ projectinfo.name }}>{{ projectinfo.name }}</option>
                                                        {% endfor %}
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;环境</label>
                                                    <select class="form-control" id="env_id">
                                                        <option value='1' selected>生产环境</option>
                                                        <option value='2'>测试环境</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;测试人</label>
                                                    <select id="qa_select" multiple="multiple"
                                                            class="form-control" data-live-search="true">
                                                        {% for gogroup in user_objs %}
                                                            <option value={{ gogroup.id }}>{{ gogroup.username }}</option>
                                                        {% endfor %}
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;重启服务 (最多选4个)</label>
                                                    <select id="reboot_services_choice" multiple="multiple"
                                                            class="form-control" data-live-search="true">

                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;是否code review</label>
                                                    <div>
                                                        <label>
                                                            <input type="radio" value="1" id="if_review1"
                                                                   name="if_review" checked="">&nbsp;是
                                                        </label>
                                                        &nbsp; &nbsp; &nbsp; &nbsp;
                                                        <label>
                                                            <input type="radio" value="2" id="if_review2"
                                                                   name="if_review">&nbsp;否
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;code review 人</label>
                                                    <select id="review_select" multiple="multiple"
                                                            class="form-control" data-live-search="true">
                                                        {% for gogroup in user_objs %}
                                                            <option value={{ gogroup.id }}>{{ gogroup.username }}</option>
                                                        {% endfor %}
                                                    </select>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;TAPD URL</label>
                                                    <textarea type="text" class="form-control" id="tapd_url"
                                                              rows="5"></textarea>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;CONSUL KEY (若有consul
                                                    key添加或修改，请让运维操作后再发布)</label>
                                                    <textarea type="text" class="form-control" id="consul_key"
                                                              rows="5"></textarea>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;事前SQL</label>
                                                    <textarea type="text" class="form-control" id="sql_before"
                                                              rows="5">无</textarea>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;事后SQL</label>
                                                    <textarea type="text" class="form-control" id="sql_after"
                                                              rows="5">无</textarea>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label>&nbsp;备注</label>
                                                    <textarea type="text" class="form-control" id="comment"
                                                              rows="5"></textarea>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <label>&nbsp;紧急发布原因（如需一级/二级审批，必填）</label>
                                                    <textarea type="text" class="form-control" id="reason"
                                                              rows="5"></textarea>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;是否影响用户浏览（首页，搜索，详情页等）</label>
                                                    <div>
                                                        <label>
                                                            <input type="radio" value="1" id="if_browse1"
                                                                   name="if_browse">&nbsp;是
                                                        </label>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                        <label>
                                                            <input type="radio" value="2" id="if_browse2"
                                                                   name="if_browse" checked="">&nbsp;否
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;是否影响订单流程（注册登录，购物车，订单，支付等）</label>
                                                    <div>
                                                        <label>
                                                            <input type="radio" value="1" id="if_order1"
                                                                   name="if_order">&nbsp;是
                                                        </label>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                        <label>
                                                            <input type="radio" value="2" id="if_order2"
                                                                   name="if_order" checked="">&nbsp;否
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="row">
                                            <div class="col-lg-6">
                                                <div class="form-group">
                                                    <span style="color: red;">*</span><label>&nbsp;是否影响履单流程（采购分配，提交发货，卖家订单处理等）</label>
                                                    <div>
                                                        <label>
                                                            <input type="radio" value="1" id="if_buy1"
                                                                   name="if_buy">&nbsp;是
                                                        </label>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                        <label>
                                                            <input type="radio" value="2" id="if_buy2"
                                                                   name="if_buy" checked="">&nbsp;否
                                                        </label>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>


                                        <br>
                                        <div class="text-center">
                                            <button class="btn btn-sm btn-primary m-t-n-xs" type="submit"
                                                    id="create_publishsheet">创建发布单
                                            </button>
                                        </div>
                                    </form>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <script src="/static/js/custom/publish_create.js"></script>
{% endblock %}